import { axios } from '@/utils/request'

export function getOrder (params) {
    return axios({
        url: 'order',
        method: 'get',
        params
    })
}

export function getOrderDetail (id) {
    return axios({
        url: `order/${ id }`,
        method: 'get'
    })
}

export function getOrderLoaned (params) {
    return axios({
        url: 'order/loaned',
        method: 'get',
        params
    })
}

export function getOrderLoanedDetail (id) {
    return axios({
        url: `order/loaned/${ id }`,
        method: 'get'
    })
}

export function orderCancel (id) {
    return axios({
        url: `order/cancel/${ id }`,
        method: 'post'
    })
}

export function orderMakeLoan (id, data) {
    return axios({
        url: `order/make_loan/${ id }`,
        method: 'post',
        data
    })
}
